﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.cms.businesslogic.datatype;

namespace ExtendedWorkFlow.DataTypes
{

    public class UserRolesDataType : umbraco.cms.businesslogic.datatype.AbstractDataEditor
    {

        #region Variables

        UserRoles _UserRoles = new UserRoles();

        #endregion

        #region Properties

        /// <summary>
        /// Unique id for the datatype
        /// </summary>
        public override Guid Id { get { return new Guid("0100460B-2957-49AE-BE77-89A060B8740C"); } }

        /// <summary>
        /// Name of the datatype
        /// </summary>
        public override string DataTypeName { get { return "ExtendedWorkFlow Users and Roles"; } }

        #endregion

        #region Constructor

        public UserRolesDataType()
            : base()
        {
            //set rendercontrol
            base.RenderControl = this._UserRoles;

            //init event            
            this._UserRoles.Init += new EventHandler(UserRoles_Initalised);

            //save event
            base.DataEditorControl.OnSave += new AbstractDataEditorControl.SaveEventHandler(UserRoles_Saving);
        }

        #endregion

        #region Control Initalisation

        void UserRoles_Initalised(object sender, EventArgs e)
        {

        }

        #endregion

        #region Saving

        void UserRoles_Saving(EventArgs e)
        {
            this._UserRoles.Save();
        }

        #endregion

    }

}